const state = {
  swiperObj: {
    link: "",
    linkName: "",
    styleName: "slide",
    poinitIdx: 0,
    delay: 3000,
    autopaly: 1,
    style: {
      backgroundPosition: "center",
      backgroundSize: "cover",
      backgroundColor: "#ff8000"
    },
    data: [
      {
        backgroungImage: "https://desk-fd.zol-img.com.cn/g5/M00/04/0B/ChMkJ1ZT0MaIKG_9AASBER52wdgAAFSMANH7AcABIEp55.jpeg",
        gourl: ""
      },
      {
        backgroungImage: "https://desk-fd.zol-img.com.cn/g5/M00/02/01/ChMkJlbKxRKIaIfpAAIU2RWOEdoAALHQgB7DDwAAhTx762.jpg",
        gourl: ""
      }
    ]
  },
  initSwiper: {
    effect: "slide",
    grabCursor: true,
    simulateTouch: false, // 拒绝接受鼠标点击事件
    observer: true, // 修改swiper自己或子元素时，自动初始化swiper
    observeParents: true, // 修改swiper的父元素时，自动初始化swiper
    pagination: {
      el: ".swiper-pagination"
    },
    autoplay: {
      delay: 2500,
      disableOnInteraction: false
    },
    onClick(swiper) {
      console.log(swiper);
    }
  }
};

const mutations = {
  SET_SWIPEROBJ: (state, swiperObj) => {
    state.initSwiper.effect = swiperObj.styleName;
    state.swiperObj = swiperObj;
  }
};

export default {
  namespaced: true,
  state,
  mutations
};
